var express = require('express');
var router = new express.Router();
var Mock = require('mockjs')
var employees = Mock.mock({
  'list|5': [{
    name:'@cname',
    age:'@natural(20,70)',
    'gender|1':['male','famale'],
    address:'@county(true)'
  }]
})
router.get('/emp', function (req, res) {

  res.send(employees.list);
})
router.get('/emp_add',function (request,response) {
  console.log(request.query);
  employees.list.unshift(request.query)
  response.send(
    {
      emps: employees.list,
      flag:true
    }
  )
})
module.exports= router;
